home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / pascal / totsrc11.zip / OVERLAY.DOC < prev    next >
Text File  |  1993-05-04  |  4KB  |  116 lines

  1. OVERLAY.DOC
  2. ===========
  3.  
  4. {               Copyright 1990 TechnoJock Software, Inc.               }
  5. {                          All Rights Reserved                         }
  6. {                         Restricted by License                        }
  7.  
  8. {                    Credits: Rob Rosenberger - thanks!                }
  9.  
  10. INTRODUCTION
  11. ============
  12. One day, Rob Rosenberg called and informed us that our Overlay section
  13. in chapter three was factually incorrect! Worst still, he was right
  14.  
  15. The bottom line is "overlaid units may have an initialization section".
  16. The only requirement is that the overlay manager must be initialized 
  17. first so it can load and execute the overlaid units.
  18.  
  19. The Toolkit includes a small unit TOTOVR.PAS which is designed as a 
  20. template unit for initializing the overlay manager. Each time you need to
  21. overlay some Toolkit units, you should make a copy of TOTOVR.PAS
  22. to a new file, e.g. AccntOVR.PAS. Then edit the name of the program overlay
  23. file (default: program.OVR) to reflect the name of the file which will 
  24. contain the compiled overlay code, e.g. ACCOUNTS.OVR.
  25.  
  26. The USES statement of the main program must list the AccntOVR file (or 
  27. whatever name you gave the unit) before the Toolkit units which are to be
  28. overlayed. For example:
  29.  
  30. program AccountsPayable;
  31. {ACCOUNTS.PAS}
  32. {$F+}
  33. USES OVERLAY,DOS,CRT,
  34.      AccntOVR, totFAST, totWIN, totIO1;
  35.  
  36. {$O totFAST}
  37. {$O totWIN}
  38. {$O totIO1}
  39.  
  40. begin
  41.    {.....}
  42. end.
  43.  
  44.  
  45. In the example, by the time the programs tries to load totFAST, the overlay
  46. manager has already been installed (by AccntOVR) and so the totFAST 
  47. initialization unit can be successfully executed as an overlay.
  48.  
  49. A new Compiler Directive OVERLAYINIT can be used with the Toolkit. If
  50. OVERLAYINIT is used in preference to OVERLAY, the Toolkit units will be
  51. compiled in an overlayable state, and the individual unit initialization
  52. sections *will* be executed, i.e. you will not need to call the  unitINIT
  53. procedures as described on page 3-8 of the manual.
  54.  
  55. A new example, DEMOVR3.PAS illustrates the use of this new compiler directive.
  56.  
  57. The use of the OVERLAY unit as described in the User's Manual (page 3-8) is
  58. still functional, and may be appropriate in some circumstances. 
  59.  
  60. UNIT DEPENDANCIES
  61. =================
  62.  
  63. This section details the Toolkit unit dependancies. In other words, the units
  64. used by each Toolkit unit. This information is important when you want to
  65. overlay Toolkit units using the OVERLAY compiler directive.
  66.  
  67. If you enable the OVERLAY compiler directive in the TOTFLAGS.INC file, you
  68. must manually call the initialization procedure for each unit. Every Toolkit
  69. unit has an initialization procedure, and this procedure name is consistently
  70. the unit name minus the TOT prefix plus the characters "INIT". For example,
  71. the initialization procedures for the TOTFAST and TOTSYS units are FASTINIT
  72. and SYSINIT, respectively.
  73.  
  74. Listed below are the unit dependancies:
  75.  
  76. totSYS   - none
  77.  
  78. totLOOK  - totSYS
  79.  
  80. totREAL  - none
  81.  
  82. totINPUT - none
  83.  
  84. totFAST  - totSYS, totLOOK, totINPUT
  85.  
  86. totWIN   - totSYS, totLOOK, totINPUT, totFAST, totSTR, totMISC
  87.  
  88. totMSG   - totSYS, totLOOK, totINPUT, totFAST, totMISC, totWIN, totSTR,
  89.            totIO1, totREAL
  90.  
  91. totLINK  - totREAL, totINPUT, totSTR
  92.  
  93. totLIST  - totSYS, totLOOK, totINPUT, totFAST, totMISC, totWIN, totSTR,
  94.            totREAL, totIO1, totLINK
  95.  
  96. totDIR   - totSYS, totLOOK, totINPUT, totFAST, totMISC, totWIN, totSTR,
  97.            totIO1, totREAL, totLINK, totDATE, totMSG, totIO2
  98.  
  99. totIO1   - totSYS, totLOOK, totINPUT, totFAST, totMISC, totWIN, totSTR,
  100.            totREAL
  101.  
  102. totIO2   - totSYS, totLOOK, totINPUT, totFAST, totMISC, totWIN, totSTR,
  103.            totIO1, totREAL, totLINK, totDATE, totMSG
  104.  
  105. totIO3   - totSYS, totLOOK, totINPUT, totFAST, totMISC, totWIN, totSTR,
  106.            totIO1, totREAL, totLINK, totDATE, totMSG, totIO2
  107.  
  108. totMENU  - totSYS, totLOOK, totINPUT, totFAST, totMISC, totWIN, totSTR,
  109.            totIO1, totREAL, totLINK
  110.  
  111. totSTR   - totREAL, totINPUT
  112.  
  113. totDATE  - totSYS, totREAL, totINPUT, totLOOK, totSTR
  114.  
  115. totMISC  - totFAST, totSTR
  116.